<!DOCTYPE html>
<html lang="en">

<head>
	<meta charset="utf-8">
	<meta http-equiv="X-UA-Compatible" content="IE=edge">
	<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
	<meta name="author" content="杨亚婷">
	<title>海盗COS</title>
	<!--<link rel="shortcut icon" href="image/icon/title.png">-->
	<link href="{{asset('public/css/bootstrap.min.css')}}" rel="stylesheet">
	<link rel="stylesheet" href="{{asset('public/css/font-awesome.css')}}">
	<link rel="stylesheet" href="{{asset('public/css/commom.css')}}">
	<link rel="stylesheet" href="{{asset('public/css/navbar.css')}}">
	<script src="{{asset('public/js/jquery.min.js')}}"></script>
	<script type="text/javascript">
		$(function(){
			$.ajax({
				 type: "GET",
				 url: "{{url('msgspush')}}?rand={{rand(1,10000)}}",
				 dataType: "json",
				 success: function(data){
					 if(data.pushNum!=0){
						 $(".pushNum").html('(你有'+data.pushNum+'条新消息)').show();
					 }
				 }
			});
			setInterval(function(){
				$.ajax({
					 type: "GET",
					 url: "{{url('msgspush')}}?rand={{rand(1,10000)}}",
					 dataType: "json",
					 success: function(data){
						 if(data.pushNum!=0){
							 $(".pushNum").html('(你有'+data.pushNum+'条新消息)').show();
						 }
					 }
				});
			},360000);
		});
	</script>
</head>
<body>
	<!--[1]navbar-->
	<nav class="navbar navbar-default navbar-fixed-top">
		<div class="container">
			<div class="navbar-header">
				<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="">
                    <span class="icon-bar"></span>
                    <span class="icon-bar"></span>
                    <span class="icon-bar"></span>
                </button>
				<div class="clearfix"></div>
				<!--logo-->
				<a href="#" class="navbar-brand webTitle">
					<!--<img src="image/icon/logo.png">-->
					<h1 class="webH1">海盗cos</h1>
				</a>
				<!--person-img-->
				<a href="#">
					<!--  这里需要判断是否是登录->-->
					<img src="{{asset('public/images/icon-menu-user.png')}}" alt="" class="yImgR">
					<img src="{{asset('public/images/cardContent1.JPEG')}}" alt="" class="headPhoto headLoginPhoto">
				</a>
			</div>
			<!--navbar-list-->
			<div id="navbar" class="collapse navbar-collapse" style="box-sizing: border-box">
				<ul class="nav navbar-nav navbar-left clearfix">
					<li class="navbarLook hover">
						<a href="{{url('/')}}">看帖</a>
					</li>
						<li class="navbarPost hover">
						<a href="{{url('/fatie')}}">发帖</a>
					</li>
				</ul>
				@if(!Auth::check())
				<ul class="nav navbar-nav navbar-right clearfix">
					<li class="myLogin">
						<a>登录</a>
					</li>
					<li class="myRegister">
					<a href="{{url('/users/register')}}">注册</a>
					</li>
				</ul>
				@else
					<ul class="nav navbar-nav navbar-right clearfix">
							<li class="loggedPhoto">
								<!--<a>登录</a>-->
								<a href="javascript:;">
									@if($avatar[0]->avatar)
									<img src="{{asset('storage').$avatar[0]->avatar}}" alt="" class="headPhoto">
									@else
									<img src="{{ asset('public/images/wu.JPEG')}}" alt="" class="headPhoto">
									@endif
								</a>
							</li>
							<li class="loggedName">
								<a href="javascript:;">{{$nickname[0]->nickname}}
									<span class="pushNum" style="display:none;"></span>
								</a>
							</li>
					</ul>
					<!--登录以后点击头像-->
					<div class="loggedClickPhoto">
						@if($avatar[0]->avatar)
					 <img src="{{asset('storage').$avatar[0]->avatar}}" alt="" class="personalPhoto">
					 <span class="pushNum" style="display:none;"></span>
				    @else
						<img src="{{ asset('public/images/wu.JPEG')}}" alt="" class="personalPhoto">
						<span class="pushNum" style="display:none;"></span>
						@endif
						<div class="personalName">{{$nickname[0]->nickname}}</div>
						<div class="clearfix">
							<div class="pull-left personalCenter"><a href="{{url('usersCenter')}}">个人中心</a></div>
							<div class="pull-right personalQuit"><a href="{{url('clientLogout')}}">退出</a></div>
						</div>
					</div>
				@endif
			</div>
		</div>
	</nav>
